namespace GraphQLDemo.Api.Extensions
{
    public class GraphQLSettings
    {
        public PathString Path { get; set; }

        public Func<HttpContext, IDictionary<string, object?>> BuildUserContext { get; set; }

        public bool EnableMetrics { get; set; }

        public static GraphQLSettings DefaultGraphQLSettings()
        {
            var graphQLSettings = new GraphQLSettings
            {
                Path = "/graphql",
                BuildUserContext = ctx => new GraphQLUserContext(ctx.User),
                EnableMetrics = false
            };
            return graphQLSettings;
        }
    }
}